Skip to content

Conversation

@oxzi
Copy link
Member

@oxzi oxzi commented Aug 6, 2024

For #41, as just requested by @Al2Klimov in #41 (comment).

@oxzi oxzi added the tests Adding tests to existing code label Aug 6, 2024
@oxzi oxzi requested a review from Al2Klimov August 6, 2024 13:35
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Aug 6, 2024
@oxzi oxzi requested a review from Al2Klimov August 8, 2024 10:38
type Options map[string]zapcore.Level

// UnmarshalText implements encoding.TextUnmarshaler to allow Options to be parsed by env.
func (o *Options) UnmarshalText(text []byte) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out the lib already supports []encoding.TextUnmarshaler, so why not map[T]encoding.TextUnmarshaler?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for trying to solve this issue upstream. I have updated the PR to reflect this potentially upcoming change in the method's signature, https://github.com/Icinga/icinga-go-library/compare/7d7fd247cd9a69fddf46f237a6ae54ba475cb7e5..2ba2d8b19d9a9460f7f58cc2cd8d31561c03edf3.

However, I am against waiting for this PR to get merged and a new env release to get drafted. If this will be supported in the future, the custom encoding.TextUnmarshaler can just be removed on our end.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written over at your env PR, it works fine. Thanks again.

However, I would still say to merge it in the current state, eventually removing the encoding.TextUnmarshaler implementation later on. We have no "influence" on the upstream, resulting in blocking this PR, resulting in blocking your PR, resulting in having less tests (your PR would be nice to have in #60) and also resulting in blocking the icinga-go-library release.

oxzi added 2 commits August 26, 2024 15:29
By implementing the encoding.TextUnmarshaler, Options can be populated
by environment variables from env.
@oxzi
Copy link
Member Author

oxzi commented Aug 26, 2024

I have just rebased this PR branch on top of the latest version of #41.

@Al2Klimov: I am once again asking for your financial support review. Afterwards, we could aim at merging your PR, which I would like to see.

@oxzi oxzi modified the milestones: 0.3.2, 0.4.0 Aug 26, 2024
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Al2Klimov Al2Klimov merged commit ab056b7 into FromEnv Sep 3, 2024
@Al2Klimov Al2Klimov deleted the FromEnv-tests branch September 3, 2024 14:12
@julianbrost julianbrost modified the milestones: 0.5.0, 0.4.0 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR tests Adding tests to existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants